﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Runda.EShop.Common.Utility
{
    /// <summary>
    /// 对应数据库中的主键
    /// </summary>
    public class PrimaryKey : Attribute
    {
    }

    /// <summary>
    /// 对应数据库中的外键
    /// </summary>
    public class ForeignKey : Attribute
    {
    }

    public class DisableFilter : Attribute
    { }

    public class UniqueCheck : Attribute
    { }

    public class ParentFiled : Attribute
    { }

    /// <summary>
    /// 对应数据库中表的名称
    /// </summary>
    public class TableName : Attribute
    {
        string name = string.Empty;

        public TableName(string tableName)
        {
            name = tableName;
        }

        public string Name
        {
            get { return name; }
        }
    }

    /// <summary>
    /// 外键依赖表
    /// </summary>
    public class ReferenceTableName : Attribute
    {
        private string _name = string.Empty;

        public ReferenceTableName(string tableName)
        {
            this._name = tableName;
        }

        public string Name
        {
            get
            {
                return this._name;
            }
        }
    }

    public class Length : Attribute
    {
        int fieldLenth = 0;
        public Length(int length)
        {
            fieldLenth = length;
        }

        public int FieldLength
        {
            get { return fieldLenth; }
        }
    }
    /// <summary>
    /// 扩展属性(不是数据库字段，不会从datareader处自动赋值)
    /// </summary>
    public class ExtendField : Attribute
    { }
 
}
